using System;
using System.Collections.Generic;
using System.Text;

namespace Weazel.Microblaze.Simulator.Engine
{
    public interface IClockUpdateVariable
    {
        void Update();
    }

    public class ClockUpdatedVariable<T> : IClockUpdateVariable
    {
        private T currentValue;
        private T nextValue;

        public T Get()
        {
            return currentValue;
        }

        public void Set(T t)
        {
            nextValue = t;
        }

        public void Update()
        {            
            currentValue = nextValue;
        }
    }
}
